home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / tenexdos.h < prev    next >
C/C++ Source or Header  |  1994-09-23  |  7KB  |  146 lines

  1. /*
  2.  * Program:    Tenexdos mail routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    12 June 1994
  13.  * Last Edited:    22 September 1994
  14.  *
  15.  * Copyright 1994 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Command bits from tenexdos_getflags(), must correspond to mbx bit values */
  37.  
  38. #define fSEEN 1
  39. #define fDELETED 2
  40. #define fFLAGGED 4
  41. #define fANSWERED 8
  42.  
  43.  
  44. /* TENEXDOS I/O stream local data */
  45.     
  46. typedef struct tenexdos_local {
  47.   int fd;            /* file descriptor for I/O */
  48.   char ch;            /* last character read in tenexdos_read */
  49.   off_t filesize;        /* file size parsed */
  50. } TENEXDOSLOCAL;
  51.  
  52.  
  53. /* Drive-dependent data passed to init method */
  54.  
  55. typedef struct tenexdos_data {
  56.   int fd;            /* file data */
  57.   unsigned long pos;        /* initial position */
  58. } TENEXDOSDATA;
  59.  
  60.  
  61. STRINGDRIVER tenexdos_string;
  62.  
  63. /* Convenient access to local data */
  64.  
  65. #define LOCAL ((TENEXDOSLOCAL *) stream->local)
  66.  
  67. /* Function prototypes */
  68.  
  69. DRIVER *tenexdos_valid (char *name);
  70. long tenexdos_isvalid (char *name);
  71. void *tenexdos_parameters (long function,void *value);
  72. void tenexdos_find (MAILSTREAM *stream,char *pat);
  73. void tenexdos_find_bboards (MAILSTREAM *stream,char *pat);
  74. void tenexdos_find_all (MAILSTREAM *stream,char *pat);
  75. long tenexdos_subscribe (MAILSTREAM *stream,char *mailbox);
  76. long tenexdos_unsubscribe (MAILSTREAM *stream,char *mailbox);
  77. long tenexdos_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  78. long tenexdos_create (MAILSTREAM *stream,char *mailbox);
  79. long tenexdos_delete (MAILSTREAM *stream,char *mailbox);
  80. long tenexdos_rename (MAILSTREAM *stream,char *old,char *new);
  81. MAILSTREAM *tenexdos_open (MAILSTREAM *stream);
  82. void tenexdos_close (MAILSTREAM *stream);
  83. void tenexdos_fetchfast (MAILSTREAM *stream,char *sequence);
  84. void tenexdos_fetchflags (MAILSTREAM *stream,char *sequence);
  85. void tenexdos_string_init (STRING *s,void *data,unsigned long size);
  86. char tenexdos_string_next (STRING *s);
  87. void tenexdos_string_setpos (STRING *s,unsigned long i);
  88. ENVELOPE *tenexdos_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  89. char *tenexdos_fetchheader (MAILSTREAM *stream,long msgno);
  90. char *tenexdos_fetchtext (MAILSTREAM *stream,long msgno);
  91. char *tenexdos_fetchbody (MAILSTREAM *stream,long m,char *sec,
  92.               unsigned long *len);
  93. char *tenexdos_slurp (MAILSTREAM *stream,unsigned long pos,
  94.               unsigned long *count);
  95. long tenexdos_read (MAILSTREAM *stream,unsigned long count,char *buffer);
  96. unsigned long tenexdos_header (MAILSTREAM *stream,long msgno,
  97.                    unsigned long *size);
  98. void tenexdos_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  99. void tenexdos_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  100. void tenexdos_search (MAILSTREAM *stream,char *criteria);
  101. long tenexdos_ping (MAILSTREAM *stream);
  102. void tenexdos_check (MAILSTREAM *stream);
  103. void tenexdos_expunge (MAILSTREAM *stream);
  104. long tenexdos_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  105. long tenexdos_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  106. long tenexdos_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  107.           STRING *message);
  108. void tenexdos_gc (MAILSTREAM *stream,long gcflags);
  109. char *tenexdos_file (char *dst,char *name);
  110. unsigned long tenexdos_size (MAILSTREAM *stream,long m);
  111. unsigned long tenexdos_822size (MAILSTREAM *stream,long msgno);
  112. long tenexdos_badname (char *tmp,char *s);
  113. long tenexdos_getflags (MAILSTREAM *stream,char *flag);
  114. long tenexdos_parse (MAILSTREAM *stream);
  115. long tenexdos_copy_messages (MAILSTREAM *stream,char *mailbox);
  116. void tenexdos_update_status (MAILSTREAM *stream,long msgno);
  117. char tenexdos_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  118. char tenexdos_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  119. char tenexdos_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  120. char tenexdos_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char tenexdos_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char tenexdos_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char tenexdos_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  124. char tenexdos_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  125. char tenexdos_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  126. char tenexdos_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  127. char tenexdos_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char tenexdos_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char tenexdos_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char tenexdos_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char tenexdos_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char tenexdos_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  133. char tenexdos_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  134. char tenexdos_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  135. char tenexdos_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  136. char tenexdos_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  137. char tenexdos_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  138. char tenexdos_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  139. char tenexdos_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  140. char tenexdos_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  141.  
  142. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  143. search_t tenexdos_search_date (search_t f,long *n);
  144. search_t tenexdos_search_flag (search_t f,long *n,MAILSTREAM *stream);
  145. search_t tenexdos_search_string (search_t f,char **d,long *n);
  146.